package com.lyncs.ods.modules.txn.service;

import com.lyncs.ods.common.api.CommonPage;
import com.lyncs.ods.req.ListPageSearchReq;
import com.lyncs.ods.req.SaveSettlementReq;
import com.lyncs.ods.resp.*;

/**
 * @author alex
 * @date 2022/3/10 14:19
 * @description
 */
public interface SettlementService {

    /**
     * 保存结算单信息
     *
     * @param req 请求信息
     * @return
     */
    Long saveSettlement(SaveSettlementReq req);

    /**
     * 获取指定条件的结算单信息
     *
     * @param req request info
     * @return 结算单信息
     */
    CommonPage<SettlementPageResp> listSettlement(ListPageSearchReq req);

    /**
     * 获取指定结算单详情
     *
     * @param settlementId 结算单id
     * @return 详情
     */
    SettlementDetailInfoResp getSettlementDetail(Long settlementId);

    /**
     * 撤销结算单
     *
     * @param settlementId 结算单id
     */
    void reverseSettlement(Long settlementId);

    /**
     * 结算单 置顶/取消
     *
     * @param settlementId settlementId
     * @param type         type
     */
    void stickyOnTop(Long settlementId, Integer type);

    /**
     * 更新结算单状态
     *
     * @param settlementId settlementId
     * @param status       status
     */
    void updateStatus(Long settlementId, Integer status);

    /**
     * 获取未完全结算交付单中的款项信息
     *
     * @param sellerId  sellerId
     * @param buyerId   buyerId
     * @param currency
     * @param deliverId
     * @param page      page
     * @param pageSize  pageSize
     * @return 未完全结算的款项信息
     */
    CommonPage<UnsettledDeliveryBillResp> listUnsettledDelivery(Long sellerId, Long buyerId, String currency, Long deliverId, Integer page, Integer pageSize);

    /**
     * 获取结算历史
     *
     * @param billId       billId
     * @param settlementId settlementId
     * @return 结算历史
     */
    SettlementBillLogResp getBillSettleLog(Long billId, Long settlementId);

    /**
     * 结算单编辑历史
     *
     * @param settlementId settlementId
     * @param page         page
     * @param pageSize     pageSize
     * @return 编辑历史
     */
    CommonPage<TxnEditLogResp> getSettlementEditLog(Long settlementId, Integer page, Integer pageSize);
}
